package com.edar.web.struts2.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AbstractUITag;

import com.edar.web.struts2.component.Page;
import com.opensymphony.xwork2.util.ValueStack;

public class PageTag extends AbstractUITag {

	private static final long serialVersionUID = 5640109537429069247L;
	private String headTitle;
	private String baseNav;
	private String numberNav;
	private String selectPageSize;
	private String input;
    private String url;   //action的路径
    
	@Override
	public Component getBean(ValueStack stack, HttpServletRequest req,HttpServletResponse res) {
		return new Page(stack, req, res);
	}

	@Override
	protected void populateParams() {
		super.populateParams();
		Page page = (Page) component;
		page.setUrl(url);
		page.setNumberNav(numberNav);
		page.setBaseNav(baseNav);
		page.setSelectPageSize(selectPageSize);
		page.setInput(input);
	}

	public String getHeadTitle() {
		return headTitle;
	}

	public void setHeadTitle(String headTitle) {
		this.headTitle = headTitle;
	}

	public String getBaseNav() {
		return baseNav;
	}

	public void setBaseNav(String baseNav) {
		this.baseNav = baseNav;
	}

	public String getNumberNav() {
		return numberNav;
	}

	public void setNumberNav(String numberNav) {
		this.numberNav = numberNav;
	}

	public String getSelectPageSize() {
		return selectPageSize;
	}

	public void setSelectPageSize(String selectPageSize) {
		this.selectPageSize = selectPageSize;
	}

	public String getInput() {
		return input;
	}

	public void setInput(String input) {
		this.input = input;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}


}
